#include "SuperShieldView.h"

using namespace view;

SuperShieldView::SuperShieldView(SuperShield* ss, SDLSurface* parentSurface, double shipWidth, double shipHeight)
{
	this->shipWidth = shipWidth;
	this->shipHeight = shipHeight;
	superShield = ss;
	surface = parentSurface;
	innerRingColor = new Color(255, 0, 0, 255);
	//innerRingColor = new Color(135, 31, 120, 255);
	//middleRingColor = new Color(159, 95, 159, 255);
	//outerRingColor = new Color(238, 130, 238, 255);
}

SuperShieldView::~SuperShieldView(void)
{
	delete innerRingColor;
	//delete middleRingColor;
	//delete outerRingColor;
}

void SuperShieldView::draw(void)
{
	if (superShield->isEnabled())
	{
		int x = (int)(shipWidth/2+superShield->getX()+0.5);
		int y = (int)(shipHeight/2+superShield->getY()+0.5);
		//Color* temp = outerRingColor;
		//outerRingColor = middleRingColor;
		//middleRingColor = innerRingColor;
		//innerRingColor = temp;
		aacircleRGBA(surface->getSurface(), x, y, superShield->getRadiusRange(), innerRingColor->getRed(), innerRingColor->getGreen(),
			innerRingColor->getBlue(), innerRingColor->getAlpha());
		aacircleRGBA(surface->getSurface(), x, y, superShield->getRadiusRange()+1, innerRingColor->getRed(), innerRingColor->getGreen(),
			innerRingColor->getBlue(), innerRingColor->getAlpha());
		//aacircleRGBA(surface->getSurface(), x, y, 40, middleRingColor->getRed(), middleRingColor->getGreen(),
			//middleRingColor->getBlue(), middleRingColor->getAlpha());
		//aacircleRGBA(surface->getSurface(), x, y, 45, outerRingColor->getRed(), outerRingColor->getGreen(),
			//outerRingColor->getBlue(), outerRingColor->getAlpha());
	}
}
